package com.wans.easyuibackend.controller;

import com.wans.easyuibackend.pojo.Result;
import com.wans.easyuibackend.pojo.StaffInfo;
import com.wans.easyuibackend.service.StaffService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@SuppressWarnings({"all"})
@CrossOrigin
public class StaffController {

    private static final Logger log = LoggerFactory.getLogger(StaffController.class);
    @Autowired
    private StaffService staffService;

    @GetMapping("/staffInfo")
    public Object findStaffInfo(Integer page, Integer rows) {
        return staffService.findStaffInfo(page, rows);
    }


    @PostMapping("/staffInfo")
    public Object addStaffInfo(StaffInfo staffInfo) {
        return staffService.addStaffInfo(staffInfo);
    }

    @PutMapping("/staffInfo")
    public Object updateStaffInfo(StaffInfo staffInfo) {
        return staffService.updateStaffInfo(staffInfo);
    }

    @DeleteMapping("/staffInfo")
    public Object deleteStaffInfo(String ids) {
        //19,18,17,16,15,14,13,12
        return staffService.deleteStaffInfo(ids);
    }
}
